<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>药品管理</title>
    <div th:insert="user/common::head"></div>
</head>

<body class="">
    <div class="wrapper ">
        <div th:insert="~{user/common::sidebar(active='drug_list.html')}"></div>
        <div class="main-panel">
            <!-- Navbar导航栏 -->
            <nav th:replace="~{user/common::navbar}"></nav>
            <!--搜索栏-->
            <div class="panel-header">
                <form id="search_form" th:action="@{/drug/search}">
                    <div class="header text-center">
                        <h2 class="title">药品管理</h2>
                        <div class="input-group no-border col-sm-4 offset-4">
                            <input type="text" name="search" class="form-control" th:placeholder="${msg==null?'药品名或者ID...':msg}">
                            <span class="input-group-addon">
                            <i class="now-ui-icons ui-1_zoom-bold" onclick="$('#search_form').submit()"></i>
                        </span>
                        </div>
                        <p class="category">搜索入库药品,支持名称模糊查询,ID精确查询。</p>
                    </div>
                </form>
            </div>
            <div class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title" style="display: inline">药品管理</h4>
                                <a th:href="@{/toDrugAdd}" class="btn-primary btn btn-lg text-white float-right" style="margin-right: 2rem">新增药品</a>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead class="text-primary">
                                            <th>
                                                药品ID
                                            </th>
                                            <th class="">
                                                药品名称
                                            </th>
                                            <th class="">
                                                药品信息
                                            </th>
                                            <th class="">
                                                药品价格
                                            </th>
                                            <th>
                                                操作
                                            </th>
                                        </thead>
                                        <tbody>
                                            <tr th:each="drug,index:${drugs}">
                                                <td th:text="${drug.getDrugId()}">
                                                    药品ID
                                                </td>
                                                <td th:text="${drug.getDrugName()}">
                                                    药品名称
                                                </td>
                                                <td th:text="${drug.getDrugInfo()}" style="width: 700px">
                                                    药品信息
                                                </td>

                                                <td th:text="${drug.getDrugPrice()}">
                                                    药品价格
                                                </td>
                                                <td>
                                                    <a href="" class="btn btn-primary" th:href="@{/toDrugInfo/}+${drug.getDrugId()}">详情</a>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--底部footer-->
            <footer th:replace="~{user/common::footer}"></footer>
        </div>
    </div>
</body>

<!--通用footerJs-->
<script th:replace="~{user/common::footerJs}"></script>

</html>
